package com.iflytek.sbd.demo.jihe.collection.list;

import java.util.Vector;

/**
 * @program: sbd
 * @description:
 * @author: 陈英俊
 * @create: 2022-01-12 14:50
 */
public class VectorDemo {


    public static void main(String[] args) {

        /**
         * 线程安全的,第一次初始化集合的时候,就是给底层10length的数组,
         * 扩容核心: 新长度 = 老长度 + capacityIncrement > 0 ? capacityIncrement :  老长度
         */
        Vector<Integer> vector1 = new Vector<>();
        Vector<Integer> vector2 = new Vector<>(12);
        Vector<Integer> vector3 = new Vector<>(12, 12);

        vector1.add(1);

    }
}

